<template>
  <view class="container">
    <view class="title">
      <u--text type="primary" :lines="4" :size="16" :text="info.noticeTitle"></u--text>
    </view>
    <u-line></u-line>
    <view class="time">
      {{ info.createBy }} 发布于：{{ info.createTime }}
    </view>
    <view class="content">
      <u-parse :content="info.noticeContent"></u-parse>
    </view>
  </view>
</template>

<script>
  import { getSysNotice } from '@/api/home'
  export default {
    data() {
      return {
        info: {}
      }
    },
    onLoad(o) {
      this.getInfo(o.id)
    },
    methods: {
      async getInfo(noticeId) {
        const { data } = await getSysNotice({ noticeId })
        this.info = data
      }
    },
		async onShareTimeline() {
			return {
				title: '柏圖教育',
				path: `/pages/message/detail?id=${this.info.noticeId}`
			}
		},
		async onShareAppMessage() {
			return {
				title: '柏圖教育',
				path: `/pages/message/detail?id=${this.info.noticeId}`
			}
		}
  }
</script>

<style scoped lang="scss">
  .container {
    padding: 10px;
    background: #fff;
		min-height: 100vh;
		box-sizing: border-box;

    .title {
      margin: 10px 0;
      text-align: left;
    }

    .time {
      margin: 20px 0;
      color: #ccc;
			font-size: 28rpx;
    }
  }
</style>
